<template>
  <div class="container">
    <el-form label-width="100px" :mode="companyInfo" ref="companyInfo">
      <el-form-item
        style="border-bottom: 1px solid #dcdfe6"
        label="企业名称"
        prop="appName"
      >
        <span style="margin-left: 20px"> {{ companyInfo.appName }}</span>
      </el-form-item>
      <el-form-item
        style="border-bottom: 1px solid #dcdfe6"
        label="收款银行"
        prop="receivingBank"
      >
        <span style="margin-left: 20px"> {{ companyInfo.receivingBank }}</span>
      </el-form-item>
      <el-form-item
        style="border-bottom: 1px solid #dcdfe6"
        label="开户地"
        prop="accountOpeningAddress"
      >
        <span style="margin-left: 20px">
          {{ companyInfo.accountOpeningAddress }}</span
        >
      </el-form-item>
      <el-form-item
        style="border-bottom: 1px solid #dcdfe6"
        label="银行账号"
        prop="bankAccount"
      >
        <span style="margin-left: 20px"> {{ companyInfo.bankAccount }}</span>
      </el-form-item>
      <el-form-item
        style="border-bottom: 1px solid #dcdfe6"
        label="发票类型"
        prop="invoiceType"
      >
        <el-radio-group
          style="margin-left: 20px"
          disabled
          v-model="companyInfo.invoiceType"
        >
          <el-radio label="1">普通发票</el-radio>
          <el-radio label="2">增值税发票</el-radio>
        </el-radio-group>
      </el-form-item>
      <el-form-item
        style="border-bottom: 1px solid #dcdfe6"
        label="税号"
        prop="taxNumber"
      >
        <span style="margin-left: 20px"> {{ companyInfo.taxNumber }}</span>
      </el-form-item>
      <el-form-item
        style="border-bottom: 1px solid #dcdfe6"
        label="税率"
        prop="taxRate"
      >
        <span style="margin-left: 20px"> {{ companyInfo.taxRate }}</span>
      </el-form-item>
      <el-form-item>
        <el-button type="danger" size="mini" @click="close">关闭</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
import { querySupplierInfo } from "@/api/supplier/supplier.js";
export default {
  // name: "companyMsgManage",
  data() {
    return {
      companyInfo: {},
    };
  },
  created() {
    this.querySupplierInfo();
  },
  methods: {
    querySupplierInfo() {
      querySupplierInfo().then((res) => {
        this.companyInfo = res.data;
      });
    },
    close() {
      this.$store.dispatch("tagsView/delView", this.$route);
      this.$router.push({ path: "/index" });
    },
    save() {
      // 验证表单信息是否正确
      this.$refs["form"].validate((valid) => {
        if (valid) {
          // updateUserProfile(this.user).then((response) => {
          //   this.msgSuccess("修改成功");
          this.$message.success("保存成功");
        } else {
          this.$message.error("请填写正确信息");
        }
      });
    },
  },
};
</script>

<style lang="scss" scoped>
.container {
  position: relative;
  overflow: hidden;
}
</style>